a5TransForm_GetData Function
Syntax
C JSONData = a5TransForm_GetData(C apikey, C formid [,L paginated [,N pageSize [,N pageNumber [,P Obj [,L flagDisplayWaitMessage]]]]])
Arguments
- apikeyCharacter
Your TransFrom API key. You can get an API key from the Developer Options section located on the Home tab in TransForm Central.
- formidCharacter
This is the ID of the TransForm form definition for which you want to get data.
- paginatedLogical
.t./.f. - defaults to .f. - Specifies if all of the forms should be returned at once, or just a single "page" of data
- pageSizeNumeric
The number of records in a page of data. Defaults to 10. Only used if paginated is .t.
- pageNumberNumeric
The page number of data to return. Defaults to 1. Only used if paginated is .t.
- ObjPointer
An object (Xbasic dot variable) that will be filled in with information when the function executes. The object will contain these properties:
- errorLogical
A .t. or .f. value. If .t., an error occurred. Otherwise, Obj.error will be false.
- errorTextCharacter
A description of the error if there was an error
- recordCountNumeric
The number of form instances that were found.
- flagDisplayWaitMessageLogical
Specifies if a "wait" message should be displayed while the function is executing. Defaults to .t.
Returns
- JSONDataCharacter
Returns a JSON array of data showing the date for the form instances. Check the value of the Obj.error parameter to determine whether or not the call was successful.
Description
Gets the data for a TransForm form.
Discussion
This function can be used to retrieve the data for a TransForm form. The result can be paginated so as not to return too much data at once.
If you request paginated data you must specify the page size and page number. For example, you might specify a page size of 10 and page number of 2. This will return 10 records, starting with the 11th record.
Example
Assume you have a form called "Pictures" and you want to retrieve the data for form
dim formId as c = "Pictures" dim apikey as c = "xxxxxxxxxxxxxxxxxxxxxxxxxx" dim jsonData as c dim flagPaginated as l = .t. dim pageSize as n = 10 dim pageNumber as n = 1 dim pResult as p jsonData = a5TransForm_GetData(apikey, formid, flagPaginated, pageSize, pageNumber, pResult)
The A5TransForm_GetData() function is a convenient ways to use the TransForm API from Xbasic. It does not add any additional functionality to the API. You can use the API in your Xbasic code to achieve the same results.
See Also